package com.workmanager.controller;

import com.workmanager.bean.ClassBean;
import com.workmanager.bean.TeacherBean;
import com.workmanager.service.TeacherClassService;
import com.workmanager.util.springUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * Created by liao on 2016/9/5.
 */
@Controller
@RequestMapping("/publishJobController")
public class publishJobController {
    @Autowired
    private TeacherClassService teacherClassService;
    @RequestMapping("/getClassList")
    public void getClassList(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        TeacherBean tea = (TeacherBean) request.getSession().getAttribute("教师");
        List<ClassBean> list = teacherClassService.getAllClassesByTeacherId(tea.getTeacher_id());
        request.setAttribute("list",list);
        request.getRequestDispatcher("/teacher/publishJob.jsp").forward(request,response);

    }
}
